cmake_minimum_required(VERSION 3.0.0)

set(CMAKE_VERBOSE_MAKEFILE on)

# 设置项目的C编译器
set(CMAKE_C_COMPILER "x86_64-elf-gcc")
# 设置项目的C编译参数
set(CMAKE_C_FLAGS "-g -c -O0 -m32 -fno-pie")


# 设置汇编语言的编译器
set(CMAKE_ASM_COMPILER "x86_64-elf-gcc")
# 添加汇编语言的编译参数
set(CMAKE_ASM_FLAGS "-g -c -O0 -m32")


# 设置链接工具前缀参数
set(LINKER_TOOL "x86_64-elf-ld")

# 设置objcopy、objdump、readelf工具参数
set(OBJCOPY "x86_64-elf-objcopy")
set(OBJDUMP "x86_64-elf-objdump")
set(READELF "x86_64-elf-readelf")

# 项目名称和语言
project(os LANGUAGES C)  
enable_language(ASM)

include_directories(${PROJECT_SOURCE_DIR}/scripts)
include_directories(${PROJECT_SOURCE_DIR}/scripts/origin/include)
include_directories(${PROJECT_SOURCE_DIR}/scripts/applib)

add_subdirectory(./scripts/boot)
add_subdirectory(./scripts/loader)
add_subdirectory(./scripts/applib)
add_subdirectory(./scripts/origin)
add_subdirectory(./scripts/shell)

add_dependencies(shell app)


